package cn.javaxc.mvcwork.controller.web;
import cn.javaxc.mvcwork.util.common.StringUtils;
public class TreeOutline{
	private String prefix;
	private String outline;
	private String outAttr;
	private int level;
	public TreeOutline(){
	}
	public TreeOutline(String prefix,String outline,String outAttr){
		this.prefix=prefix;
		this.outline=outline;
		this.outAttr=outAttr;
	}
	public TreeOutline(String prefix,String outline,String outAttr,int level){
		this(prefix,outline,outAttr);
		this.level=level;
	}

	public String getPrefix(){
		return this.prefix;
	}
	public void setPrefix(String prefix){
		this.prefix=prefix;
	}
	public String getOutline(){
		return this.outline;
	}
	public void setOutline(String outline){
		this.outline=outline;
	}
	public String getOutAttr(){
		if (outAttr!=null){
			String pre=StringUtils.getPrefix(outAttr,".");
			String suf=StringUtils.getSuffix(outAttr,".");
			if (!outAttr.equals(pre)&&!outAttr.equals(suf)){
				return pre+"-"+suf;
			}
		}
		return outAttr;
	}
	public void setOutAttr(String outAttr){
		this.outAttr=outAttr;
	}
	public int getLevel(){
		return this.level;
	}
	public void setLevel(int level){
		this.level=level;
	}
	public String toString(){
		return "Outline:"+getOutline()+" "+"OutAttr:"+getOutAttr()+" "+"Prefix:"+getPrefix();
	}

}
